<template>
  <div class="header-nav">
    <el-row :gutter="10" class="headerBackGound headerBox">
      <el-col :lg="0" :md="0" :sm="0" :xs="4">
        <img src="~assets/img/common/newlogo.png" class="headerLogo" alt />
      </el-col>
      <el-col :lg="6" :md="4" :sm="4" :xs="0">
        <div class="logoImage">
          <img src="~assets/img/common/newlogo.png" class="headerLogo" alt />
        </div>
      </el-col>
      <el-col :lg="10" :md="12" :sm="12" :xs="0" :offset="8">
        <div class="headerTitle">
          <el-dropdown>
            <span class="el-dropdown-link">
              <a href="/#/centerHome/centerIntroduce" style="text-decoration: none; color: #fff">首页</a>
              <i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>
                <a href="/#/centerHome/centerDetails" class="headerTitle-a">详情介绍</a>
              </el-dropdown-item>
              <el-dropdown-item>
                <a href="/#/centerHome/expertIntro" class="headerTitle-a">专家站</a>
              </el-dropdown-item>
              <el-dropdown-item>
                <a href="/#/centerHome/leaderCare" class="headerTitle-a">领导关怀</a>
              </el-dropdown-item>
              <el-dropdown-item>
                <a href="https://www.sapcloudcc.com/" class="headerTitle-a">成长型社区</a>
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          <el-dropdown>
            <span class="el-dropdown-link">
              <a href="/#/quoteHome/" style="text-decoration:none;color: #fff;">行情资讯</a>
              <i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>
                <a href="/#/quoteHome/informationsNews" class="headerTitle-a">资讯新闻</a>
              </el-dropdown-item>
              <el-dropdown-item>
                <a href="/#/quoteHome/expertArticles" class="headerTitle-a">专家文章</a>
              </el-dropdown-item>
              <el-dropdown-item>
                <a href="/#/quoteHome/sharingData" class="headerTitle-a">共享资料</a>
              </el-dropdown-item>
              <el-dropdown-item>
                <a href="/#/quoteHome/custormerCase" class="headerTitle-a">客户案例</a>
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>

          <el-dropdown>
            <span class="el-dropdown-link" style="cursor:pointer;" @click="enterHome">
              个人中心
              <i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item @click.native="dialogFormVisible = true">帐号登录</el-dropdown-item>
              <el-dropdown-item>
                <a class="headerTitle-a" @click="leaveHome">退出登录</a>
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          <!-- <el-dropdown v-if="currentType!==9">
            <span class="el-dropdown-link" style="cursor:pointer;" @click="messageEdit">信息填报</span>
            <el-dropdown-menu></el-dropdown-menu>
          </el-dropdown> -->
        </div>
      </el-col>
      <el-col :lg="0" :md="0" :sm="0" :xs="4" :offset="16">
        <div class="burger" @click="showBoxList">
          <div></div>
          <div></div>
          <div></div>
        </div>
      </el-col>
    </el-row>

    <div :class="{ isShow }" class="menuList">
      <el-menu background-color="#333333" text-color="#cccccc" :unique-opened="true">
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-s-home"></i>首页
          </template>
          <el-menu-item index="1-1">
            <a href="/#/centerHome/centerIntroduce">赋能中心</a>
          </el-menu-item>
          <el-menu-item index="1-2">
            <a href="/#/centerHome/centerDetails">详情介绍</a>
          </el-menu-item>
          <el-menu-item index="1-3">
            <a href="/#/centerHome/leaderCare">领导关怀</a>
          </el-menu-item>
          <el-menu-item index="1-4">
            <a href="https://www.sapcloudcc.com/">成长型社区</a>
          </el-menu-item>
        </el-submenu>
        <el-submenu index="2">
          <template slot="title">
            <i class="el-icon-message"></i>
            <a href="/#/quoteHome/" style="text-decoration:none;color: #ccc;">行情资讯</a>
          </template>
          <el-menu-item index="2-1">
            <a href="/#/quoteHome/informationsNews">资讯新闻</a>
          </el-menu-item>
          <el-menu-item index="2-2">
            <a href="/#/quoteHome/expertArticles">专家文章</a>
          </el-menu-item>
          <el-menu-item index="2-3">
            <a href="/#/quoteHome/sharingData">共享资料</a>
          </el-menu-item>
          <el-menu-item index="2-4">
            <a href="/#/quoteHome/custormerCase">客户案例</a>
          </el-menu-item>
        </el-submenu>
        <el-submenu index="3">
          <template slot="title" @click="enterHome">
            <i class="el-icon-user"></i>个人中心
          </template>
          <el-menu-item index="3-2" @click.native="dialogFormVisiblePhone = true">帐号登录</el-menu-item>
          <el-menu-item index="3-2" @click="messageEdit">信息填报</el-menu-item>
          <el-menu-item index="3-3" @click="leaveHome">退出登录</el-menu-item>
        </el-submenu>
      </el-menu>
    </div>

    <el-dialog :visible.sync="dialogFormVisible" custom-class="customWidth" width="500px">
      <div class="imgTitle">
        <img src="~assets/img/common/newlogo.png" class="Logo" alt />
      </div>
      <el-form
        :model="loginForm"
        class="loginForm"
        :rules="loginRules"
        label-position="left"
        label-width="100px"
      >
        <el-form-item label="邮箱/手机号" :label-width="formLabelWidth" prop="name">
          <el-input
            type="text"
            v-model="loginForm.name"
            autocomplete="off"
            placeholder="请输入您的邮箱/手机号"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="密码" :label-width="formLabelWidth" prop="password">
          <el-input
            type="password"
            v-model="loginForm.password"
            autocomplete="off"
            placeholder="请输入密码"
            clearable
          ></el-input>
        </el-form-item>
      </el-form>
      <div class="button">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="login">登录</el-button>
      </div>
      <div slot="footer" class="dialog-footer footer">
        <!--        <p>忘记密码？使用邮箱找回</p>-->
        <p @click="registerAdd">还没有帐号？点击注册</p>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="dialogFormVisiblePhone" width="100%">
      <div class="imgTitle">
        <img src="~assets/img/common/newlogo.png" class="Logo" alt />
      </div>
      <el-form
        :model="loginForm"
        class="loginForm"
        :rules="loginRules"
        label-position="left"
        label-width="80px"
      >
        <el-form-item label="邮箱/手机号" :label-width="formLabelWidth" prop="name">
          <el-input
            type="text"
            v-model="loginForm.name"
            autocomplete="off"
            placeholder="请输入您的邮箱/手机号"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="密码" :label-width="formLabelWidth" prop="password">
          <el-input
            type="password"
            v-model="loginForm.password"
            autocomplete="off"
            placeholder="请输入密码"
            clearable
          ></el-input>
        </el-form-item>
      </el-form>
      <div class="button">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="login">登录</el-button>
      </div>
      <div slot="footer" class="dialog-footer footer">
        <!--        <p>忘记密码？使用邮箱找回</p>-->
        <p @click="registerAddPhone">还没有帐号？点击注册</p>
      </div>
    </el-dialog>

    <el-dialog :visible.sync="registerFormVisible" width="500px">
      <div class="imgTitle">
        <img src="~assets/img/common/newlogo.png" class="Logo" alt />
      </div>
      <el-form
        :model="Registerform"
        class="RegisterForm"
        :rules="registerRules"
        label-position="left"
        label-width="100px"
      >
        <!-- <el-form-item label="税号" :label-width="formLabelWidth" prop="dutyParagraph">
          <el-input type="text" autocomplete="off" placeholder="请输入您的企业税号" clearable></el-input>
        </el-form-item>
        <el-form-item label="公司" :label-width="formLabelWidth" prop="company">
          <el-input type="text" autocomplete="off" placeholder="请输入您的企业名称" clearable></el-input>
        </el-form-item>-->
        <el-form-item label="请选择您的身份" :label-width="formLabelWidth" prop="radio">
          <el-radio-group v-model="Registerform.radio" class="selectRadio">
            <el-radio
              v-model="Registerform.radio"
              v-for="(item,index) in radioArr"
              :key="index"
              :label="item.id"
            >{{item.name}}</el-radio>
          </el-radio-group>
        </el-form-item>
<!--        <el-form-item label="用户名" :label-width="formLabelWidth" prop="username">-->
<!--          <el-input-->
<!--            type="text"-->
<!--            v-model="Registerform.username"-->
<!--            autocomplete="off"-->
<!--            placeholder="请输入您的用户名"-->
<!--            clearable-->
<!--          ></el-input>-->
<!--        </el-form-item>-->
        <el-form-item
                label="手机号"
                :label-width="formLabelWidth"
                prop="telphone"
        >
          <el-input
                  type="text"
                  v-model="Registerform.telphone"
                  autocomplete="off"
                  placeholder="请输入您的手机号"
                  oninput="value=value.replace(/[^\d]/g,'');if(value.length > 11)value = value.slice(0, 11)"
                  clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="邮箱" :label-width="formLabelWidth" prop="email">
          <el-input
            type="text"
            v-model="Registerform.email"
            autocomplete="off"
            placeholder="请输入您的邮箱"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="密码" :label-width="formLabelWidth" prop="password">
          <el-input
            type="password"
            v-model="Registerform.password"
            autocomplete="off"
            placeholder="请输入密码"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="确认密码" :label-width="formLabelWidth" prop="checkPass">
          <el-input
            type="password"
            v-model="Registerform.checkPass"
            autocomplete="off"
            placeholder="请再次输入密码"
            clearable
          ></el-input>
        </el-form-item>
      </el-form>
      <div class="button">
        <el-button @click="registerFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="register">注 册</el-button>
      </div>
      <div slot="footer" class="dialog-footer footer">
        <p @click="loginAdd">已有SAP帐号？点击登录</p>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="registerFormVisiblePhone" width="100%">
      <div class="imgTitle">
        <img src="~assets/img/common/newlogo.png" class="Logo" alt />
      </div>
      <el-form
        :model="Registerform"
        class="RegisterForm"
        :rules="registerRules"
        label-position="left"
        label-width="100px"
      >
        <!-- <el-form-item label="税号" :label-width="formLabelWidth" prop="dutyParagraph">
          <el-input type="text" autocomplete="off" placeholder="请输入您的企业税号" clearable></el-input>
        </el-form-item>
        <el-form-item label="公司" :label-width="formLabelWidth" prop="company">
          <el-input type="text" autocomplete="off" placeholder="请输入您的企业名称" clearable></el-input>
        </el-form-item>-->
        <el-form-item label="请选择您的身份" :label-width="formLabelWidth" prop="radio">
          <el-radio-group v-model="Registerform.radio" class="selectRadio">
            <el-radio
              v-model="Registerform.radio"
              v-for="(item,index) in radioArr"
              :key="index"
              :label="item.id"
            >{{item.name}}</el-radio>
          </el-radio-group>
        </el-form-item>
<!--        <el-form-item label="用户名" :label-width="formLabelWidth" prop="username">-->
<!--          <el-input-->
<!--            type="text"-->
<!--            v-model="Registerform.username"-->
<!--            autocomplete="off"-->
<!--            placeholder="请输入您的用户名"-->
<!--            clearable-->
<!--          ></el-input>-->
<!--        </el-form-item>-->
        <el-form-item
                label="手机号"
                :label-width="formLabelWidth"
                prop="telphone"
        >
          <el-input
                  type="text"
                  v-model="Registerform.telphone"
                  autocomplete="off"
                  placeholder="请输入您的手机号"
                  oninput="value=value.replace(/[^\d]/g,'');if(value.length > 11)value = value.slice(0, 11)"
                  clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="邮箱" :label-width="formLabelWidth" prop="email">
          <el-input
            type="text"
            v-model="Registerform.email"
            autocomplete="off"
            placeholder="请输入您的邮箱"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="密码" :label-width="formLabelWidth" prop="password">
          <el-input
            type="password"
            v-model="Registerform.password"
            autocomplete="off"
            placeholder="请输入密码"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item label="确认密码" :label-width="formLabelWidth" prop="checkPass">
          <el-input
            type="password"
            v-model="Registerform.checkPass"
            autocomplete="off"
            placeholder="请再次输入密码"
            clearable
          ></el-input>
        </el-form-item>
      </el-form>
      <div class="button">
        <el-button @click="registerFormVisiblePhone = false">取 消</el-button>
        <el-button type="primary" @click="register">注 册</el-button>
      </div>
      <div slot="footer" class="dialog-footer footer">
        <p @click="loginAddPhone">已有SAP帐号？点击登录</p>
      </div>
    </el-dialog>

    <div class="fill">
      <div class="fill-pc" v-if="!flag">
        <!-- 企业 -->
        <el-dialog :visible.sync="fillVisible" width="35%" class="industry" v-if="currentType==11">
          <h2>企业用户信息填报</h2>
          <el-form
            :model="fillForm"
            ref="ruleForm"
            label-width="100px"
            class="demo-ruleForm"
            label-position="left"
          >
            <el-form-item label="企业名称" prop="enterpriseName">
              <el-input v-model="fillForm.enterpriseName" type="text" placeholder="请输入企业名称"></el-input>
            </el-form-item>
            <el-form-item label="所属行业" prop="industry">
              <el-input v-model="fillForm.industry" type="text" placeholder="请输入所属行业"></el-input>
            </el-form-item>
            <el-form-item label="公司性质" prop="type">
              <el-input v-model="fillForm.type" placeholder="请输入公司性质"></el-input>
            </el-form-item>
            <el-form-item label="增值税登记号" prop="taxNo">
              <el-input v-model="fillForm.taxNo" placeholder="请输入增值税登记号"></el-input>
            </el-form-item>
            <el-form-item label="地址" prop="address">
              <el-input v-model="fillForm.address" placeholder="请输入地址"></el-input>
            </el-form-item>
            <el-form-item label="开票名称" prop="billingName">
              <el-input v-model="fillForm.billingName" placeholder="请输入开票名称"></el-input>
            </el-form-item>
            <el-form-item label="联系人" prop="contactUser">
              <el-input v-model="fillForm.contactUser" placeholder="请输入联系人"></el-input>
            </el-form-item>
          </el-form>
          <div class="btn">
            <el-button @click="fillVisible = false">取消</el-button>
            <el-button type="primary" @click="enterpriseuserUpdate()">保存</el-button>
          </div>
        </el-dialog>
        <!-- 个人顾问 -->
        <el-dialog
          :visible.sync="fillVisible"
          width="35%"
          class="personaluser"
          v-if="currentType==12"
        >
          <h2>个人顾问信息填报</h2>
          <el-form
            :model="fillForm"
            ref="ruleForm"
            label-width="100px"
            class="demo-ruleForm"
            label-position="left"
          >
            <el-form-item label="姓名" prop="name">
              <el-input v-model="fillForm.name" placeholder="请输入真实姓名"></el-input>
            </el-form-item>
            <el-form-item label="擅长领域" prop="expertise">
              <el-input v-model="fillForm.expertise" placeholder="请输入擅长领域"></el-input>
            </el-form-item>
            <el-form-item label="从业年限" prop="bmiHistory">
              <el-input v-model="fillForm.bmiHistory" placeholder="请输入从业年限"></el-input>
            </el-form-item>
            <el-form-item label="行业经验" prop="industryExperience">
              <el-input v-model="fillForm.industryExperience" placeholder="请输入行业经验"></el-input>
            </el-form-item>
            <el-form-item label="学历" prop="education">
              <el-input v-model="fillForm.education" placeholder="请输入学历"></el-input>
            </el-form-item>
            <el-form-item label="毕业院校" prop="graduatedFrom">
              <el-input v-model="fillForm.graduatedFrom" placeholder="请输入毕业院校"></el-input>
            </el-form-item>
            <el-form-item label="专业" prop="major">
              <el-input v-model="fillForm.major" type="text" placeholder="请输入专业"></el-input>
            </el-form-item>
            <el-form-item label="服务方向" prop="serviceDirection">
              <el-input v-model="fillForm.expertise" placeholder="请输入服务方向"></el-input>
            </el-form-item>
            <el-form-item label="生 日" prop="brithday">
              <el-input v-model="fillForm.brithday" placeholder="请输入生日"></el-input>
            </el-form-item>
            <el-form-item label="照 片" prop="photoUrl">
              <el-upload
                class="upload-demo"
                action="http://112.124.67.43:8088/iot/demand/fileUpload"
                :on-change="handleChange"
                :on-success="personaluserPhotoUrl"
                :file-list="fileListPhotoUrl"
                :limit="1"
              >
                <el-button size="small" type="primary">点击上传</el-button>
                <div slot="tip" class="el-upload__tip">只能上传一个文件,如果需要上传多个文件,请上传压缩文件</div>
              </el-upload>
            </el-form-item>
            <el-form-item label="简 历" prop="resumeFileUrl">
              <el-upload
                class="upload-demo"
                action="http://112.124.67.43:8088/iot/demand/fileUpload"
                :on-change="handleChange"
                :on-success="personaluserResumeFileUrl"
                :file-list="fileListResume"
                :limit="1"
              >
                <el-button size="small" type="primary">点击上传</el-button>
                <div slot="tip" class="el-upload__tip">只能上传一个文件,如果需要上传多个文件,请上传压缩文件</div>
              </el-upload>
            </el-form-item>
          </el-form>

          <div class="btn">
            <el-button @click="fillVisible = false;">取消</el-button>
            <el-button type="primary" @click="personaluserUpdate">保存</el-button>
          </div>
        </el-dialog>
        <!-- 合作伙伴 -->
        <el-dialog
          :visible.sync="fillVisible"
          width="35%"
          class="cooperativeuser"
          v-if="currentType==10"
        >
          <h2>合作伙伴信息填报</h2>
          <el-form
            :model="fillForm"
            ref="ruleForm"
            label-width="100px"
            class="demo-ruleForm"
            label-position="left"
          >
            <el-form-item label="企业名称" prop="industry">
              <el-input v-model="fillForm.industry" placeholder="请输入企业名称"></el-input>
            </el-form-item>
            <el-form-item label="地址" prop="address">
              <el-input v-model="fillForm.address" placeholder="请输入地址"></el-input>
            </el-form-item>
            <el-form-item label="联系人" prop="name">
              <el-input v-model="fillForm.name" placeholder="请输入联系人"></el-input>
            </el-form-item>
            <el-form-item label="服务内容" prop="serviceContent">
              <el-input v-model="fillForm.serviceContent" type="text" placeholder="请输入服务内容"></el-input>
            </el-form-item>
            <el-form-item label="服务产品" prop="serviceProduct">
              <el-input v-model="fillForm.serviceProduct" placeholder="请输入服务产品"></el-input>
            </el-form-item>
            <el-form-item label="人员规模" prop="staffSize">
              <el-input v-model="fillForm.staffSize" placeholder="请输入人员规模"></el-input>
            </el-form-item>
            <el-form-item label="企业logo" prop="logoUrl">
              <el-upload
                class="upload-demo"
                action="http://112.124.67.43:8088/iot/demand/fileUpload"
                :on-change="handleChange"
                :on-success="cooperativeuserLogoUrl"
                :file-list="fileList"
                :limit="1"
              >
                <el-button size="small" type="primary">点击上传</el-button>
                <div slot="tip" class="el-upload__tip">当前上传logo将会覆盖之前的logo</div>
              </el-upload>
            </el-form-item>
          </el-form>
          <div class="btn">
            <el-button @click="fillVisible = false;">取消</el-button>
            <el-button type="primary" @click="cooperativeuserUpdate">保存</el-button>
          </div>
        </el-dialog>
      </div>
      <div class="fill-phone" v-if="flag">
        <div class="phone" v-if="currentType==11" v-show="fillVisible">
          <div class="title">
            <h2>企业用户信息填报</h2>
            <span @click="fillVisible = false;">
              <i class="el-icon-s-fold"></i>
            </span>
          </div>
          <ul>
            <li>
              <span>企业名称</span>
              <el-input v-model="fillForm.enterpriseName"></el-input>
            </li>
            <li>
              <span>所属行业</span>
              <el-input v-model="fillForm.industry"></el-input>
            </li>
            <li>
              <span>公司性质</span>
              <el-input v-model="fillForm.type"></el-input>
            </li>
            <li>
              <span>增值税登记号</span>
              <el-input v-model="fillForm.taxNo"></el-input>
            </li>
            <li>
              <span>地址</span>
              <el-input v-model="fillForm.address"></el-input>
            </li>
            <li>
              <span>开票名称</span>
              <el-input v-model="fillForm.billingName"></el-input>
            </li>
            <li>
              <span>联系人</span>
              <el-input v-model="fillForm.contactUser"></el-input>
            </li>
            <div class="btn action">
              <el-button type="primary" @click="fillVisible = false;">取消</el-button>
              <el-button type="primary" @click="enterpriseuserUpdate">保存</el-button>
            </div>
          </ul>
        </div>
        <div class="phone" v-if="currentType==12" v-show="fillVisible">
          <div class="title">
            <h2>个人顾问信息填报</h2>
            <span @click="fillVisible = false;">
              <i class="el-icon-s-fold"></i>
            </span>
          </div>
          <ul>
            <li>
              <span>姓名</span>
              <el-input v-model="fillForm.name"></el-input>
            </li>
            <li>
              <span>擅长领域</span>
              <el-input v-model="fillForm.expertise"></el-input>
            </li>
            <li>
              <span>从业年限</span>
              <el-input v-model="fillForm.bmiHistory"></el-input>
            </li>
            <li>
              <span>行业经验</span>
              <el-input v-model="fillForm.industryExperience"></el-input>
            </li>
            <li>
              <span>学历</span>
              <el-input v-model="fillForm.education"></el-input>
            </li>
            <li>
              <span>毕业院校</span>
              <el-input v-model="fillForm.graduatedFrom"></el-input>
            </li>
            <li>
              <span>专业</span>
              <el-input v-model="fillForm.major"></el-input>
            </li>
            <li>
              <span>服务方向</span>
              <el-input v-model="fillForm.serviceDirection"></el-input>
            </li>
            <li>
              <span>生 日</span>
              <el-input v-model="fillForm.brithday" placeholder="2020/01/02"></el-input>
            </li>
            <li>
              <span>照片</span>
              <span>
                <el-upload
                  class="upload-demo"
                  action="http://112.124.67.43:8088/iot/demand/fileUpload"
                  :on-change="handleChange"
                  :on-success="personaluserPhotoUrl"
                  :file-list="fileListPhotoUrl"
                  :limit="1"
                >
                  <el-button size="small" type="primary">点击上传</el-button>
                </el-upload>
              </span>
            </li>
            <li>
              <span>简历</span>
              <span>
                <el-upload
                  class="upload-demo"
                  action="http://112.124.67.43:8088/iot/demand/fileUpload"
                  :on-change="handleChange"
                  :on-success="personaluserResumeFileUrl"
                  :file-list="fileListResume"
                  :limit="1"
                >
                  <el-button size="small" type="primary">点击上传</el-button>
                </el-upload>
              </span>
            </li>
            <div class="btn action">
              <el-button type="primary" @click="fillVisible = false;">取消</el-button>
              <el-button type="primary" @click="personaluserUpdate">保存</el-button>
            </div>
          </ul>
        </div>
        <div class="phone" v-if="currentType==10" v-show="fillVisible">
          <div class="title">
            <h2>合作伙伴信息填报</h2>
            <span @click="fillVisible = false;">
              <i class="el-icon-s-fold"></i>
            </span>
          </div>
          <ul>
            <li>
              <span>企业名称</span>
              <el-input v-model="fillForm.industry"></el-input>
            </li>
            <li>
              <span>地址</span>
              <el-input v-model="fillForm.address"></el-input>
            </li>
            <li>
              <span>联系人</span>
              <el-input v-model="fillForm.name"></el-input>
            </li>
            <li>
              <span>服务内容</span>
              <el-input v-model="fillForm.serviceContent"></el-input>
            </li>
            <li>
              <span>服务产品</span>
              <el-input v-model="fillForm.serviceProduct"></el-input>
            </li>
            <li>
              <span>人员规模</span>
              <el-input v-model="fillForm.staffSize"></el-input>
            </li>
            <li>
              <span>企业logo</span>
              <span>
                <el-upload
                  class="upload-demo"
                  action="http://112.124.67.43:8088/iot/demand/fileUpload"
                  :on-change="handleChange"
                  :on-success="cooperativeuserLogoUrl"
                  :file-list="fileList"
                  :limit="1"
                >
                  <el-button size="small" type="primary">点击上传</el-button>
                </el-upload>
              </span>
            </li>
            <div class="btn action">
              <el-button type="primary" @click="fillVisible = false;">取消</el-button>
              <el-button type="primary" @click="cooperativeuserUpdate">保存</el-button>
            </div>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import axios from "axios";
import {
  ReqEnterpriseuserUpdate,
  ReqPersonaluserUpdate,
  ReqCooperativeuserUpdate,
  ReqInforoId,
  ReqRegister,
  ReqAddPersonal,
  ReqUserexit
} from "../../src/request/index";
export default {
  data() {
    var validatePass = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请输入密码"));
      } else {
        if (this.Registerform.checkPass !== "") {
          this.$refs.form.validateField("checkPass");
        }
        callback();
      }
    };
    var validatePass2 = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请再次输入密码"));
      } else if (value !== this.Registerform.password) {
        callback(new Error("两次输入密码不一致!"));
      } else {
        callback();
      }
    };
    return {
      fillVisible: false,
      // 信息填报对象
      fillForm: {},
      // 文件列表
      fileList: [],
      fileListPhotoUrl: [],
      fileListResume: [],
      flag: false,
      currentType: -1,
      // idType: 10,
      // id: "1",
      id: "",
      isShow: true,
      dialogFormVisiblePhone: false,
      registerFormVisiblePhone: false,
      // registerJump: false,
      registerFormVisible: false,
      dialogFormVisible: false,
      loginForm: {
        name: "",
        password: ""
      },
      Registerform: {
        dutyParagraph: "",
        company: "",
        email: "",
        password: "",
        checkPass: "",
        telphone: "",
        username: "",
        radio: "11"
      },
      radioArr: [
        {
          name: "企业用户",
          id: "11"
        },
        {
          name: "个人顾问",
          id: "12"
        }
      ],
      formLabelWidth: "120px",
      loginRules: {
        name: [
          {
            required: true,
            message: "请输入您的手机号/邮箱",
            trigger: "blur"
          }
        ],
        password: [{ required: true, message: "请输入密码", trigger: "blur" }]
      },
      registerRules: {
        dutyParagraph: [
          { required: true, message: "请输入税号", trigger: "blur" }
        ],
        username: [
          { required: true, message: "请输入用户名", trigger: "blur" }
        ],
        email: [
          { required: true, message: "请输入邮箱地址", trigger: "blur" },
          {
            type: "email",
            message: "请输入正确的邮箱地址",
            trigger: ["blur", "change"]
          }
        ],
        telphone: [
          { required: true, message: "请输入公司名称", trigger: "blur" }
        ],
        company: [
          { required: true, message: "请输入联系方式", trigger: "blur" }
        ],
        password: [
          { required: true, validator: validatePass, trigger: "blur" }
        ],
        checkPass: [
          { required: true, validator: validatePass2, trigger: "blur" }
        ]
      }
    };
  },
  methods: {
    showBoxList() {
      this.isShow = !this.isShow;
    },
    // enterWriteInfo() {
    //   this.$router.history.push("/self/manage/personInfoWriteMobel");
    // },
    registerAdd() {
      (this.registerFormVisible = true), (this.dialogFormVisible = false);
    },
    loginAdd() {
      (this.registerFormVisible = false), (this.dialogFormVisible = true);
    },
    registerAddPhone() {
      (this.registerFormVisiblePhone = true),
        (this.dialogFormVisiblePhone = false);
    },
    loginAddPhone() {
      (this.registerFormVisiblePhone = false),
        (this.dialogFormVisiblePhone = true);
    },
    // selectUser(item) {
    //   if (item == "11" || item == "12") {
    //     this.registerJump = true;
    //   } else {
    //     this.registerJump = false;
    //   }
    // },
    login() {
      axios({
        url: "http://112.124.67.43:8088/iot/user/login",
        method: "post",
        data: {
          username: this.loginForm.name,
          password: this.loginForm.password
        }
      }).then(res => {
        if (res.data.msg === "success") {
          const data = res.data;
          const token = res.headers.token;
          let userId = data.user.id;
          let userType = data.user.userType;
          this.id = userId;
          sessionStorage.setItem("id", userId);
          sessionStorage.setItem("userType", userType);
          sessionStorage.setItem("token", token);
          sessionStorage.setItem("username", data.user.username);
          this.$message({
            showClose: true,
            message: "恭喜你，登录成功",
            type: "success"
          });
          this.dialogFormVisible = false;
          this.dialogFormVisiblePhone = false;
          if (userType === 9 || userType === 13) {
            this.$router.push({
              path: "/self/manage/manUser"
            });
          } else if (userType === 10) {
            this.$router.push({
              path: "/self/partner/partIndex"
            });
          } else if (userType === 11) {
            this.$router.push({
              path: "/self/company/compIndex"
            });
          } else if (userType === 12) {
            this.$router.push({
              path: "/self/adviser/advIndex"
            });
          }
        } else {
          this.$message({
            showClose: true,
            message: "登录失败",
            type: "error"
          });
        }
      });
    },
    async register() {
      let data = {
        email: this.Registerform.email,
        id: "",
        password: this.Registerform.password,
        status: 0,
        telephone: this.Registerform.telphone,
        userType: this.Registerform.radio,
        username: "",
      };
      let registerInfo = await ReqRegister(data);
      // console.log(registerInfo);
      if (registerInfo.msg === "success") {
        this.$message({
          showClose: true,
          message: "恭喜你，注册成功",
          type: "success",
        });
        this.Registerform.email = "";
        this.Registerform.password = "";
        this.Registerform.telphone = "";
        this.Registerform.checkPass = "";
        this.registerFormVisiblePhone = false;
        this.registerFormVisible = false;
      } else if (registerInfo.msg === "电话号码已存在") {
        this.$message({
          showClose: true,
          message: "电话号码已存在",
          type: "error",
        });
      }else if (registerInfo.msg === "邮箱号已存在") {
        this.$message({
          showClose: true,
          message: "邮箱已存在",
          type: "error",
        });
      } else {
        this.$message({
          showClose: true,
          message: "注册失败",
          type: "error",
        });
      }
    },
    // 点击信息填报
    messageEdit() {
      if (!this.currentType) {
        this.$message({
          message: "请先登录",
          type: "error"
        });
      } else {
        this.fillVisible = true;
      }
    },
    // 企业用户信息填报保存
    async enterpriseuserUpdate() {
      this.fillForm.id = sessionStorage.getItem("id");
      this.fillForm.status = 0;
      let res = await ReqEnterpriseuserUpdate(this.fillForm);
      this.fillVisible = false;
      if (res.msg == "success") {
        this.$message({
          message: "填报成功",
          type: "success"
        });
      }
    },
    // 个人顾问信息填报保存
    async personaluserUpdate() {
      this.fillForm.id = sessionStorage.getItem("id");
      this.fillForm.status = 0;
      let res = await ReqPersonaluserUpdate(this.fillForm);
      this.fillVisible = false;
      if (res.msg == "success") {
        this.$message({
          message: "填报成功",
          type: "success"
        });
      }
    },
    // 合作伙伴信息填报保存
    async cooperativeuserUpdate() {
      this.fillForm.id = sessionStorage.getItem("id");
      this.fillForm.status = 0;
      let res = await ReqCooperativeuserUpdate(this.fillForm);
      this.fillVisible = false;
      if (res.msg == "success") {
        this.$message({
          message: "填报成功",
          type: "success"
        });
      }
    },
    // 对文件列表操作
    handleChange(file, fileList) {
      this.fileList = fileList.slice(-3);
    },
    // 个人顾问照片上传成功时
    personaluserPhotoUrl(response, file, fileList) {
      this.fillForm.photoUrl = response.msg;
      if (response.code == 0) {
        this.$message({
          message: "上传成功",
          type: "success"
        });
      }
    },
    // 个人顾问简历上传成功
    personaluserResumeFileUrl(response, file, fileList) {
      this.fillForm.resumeFileUrl = response.msg;
      if (response.code == 0) {
        this.$message({
          message: "上传成功",
          type: "success"
        });
      }
    },
    // 合作伙伴企业照片上传成功时
    cooperativeuserLogoUrl(response, file, fileList) {
      this.fillForm.logoUrl = response.msg;
      if (response.code == 0) {
        this.$message({
          message: "上传成功",
          type: "success"
        });
      }
    },
    // 判断是否是手机端
    _isMobile() {
      let flag = navigator.userAgent.match(
        /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
      );
      return flag;
    },
    // 根据用户id查询用户具体信息
    async infoId() {
      // console.log(sessionStorage.getItem('id'),"hahah")
      let res = await ReqInforoId(sessionStorage.getItem("id"));
      // console.log(res);
      if (res.userInfo.userInfo == undefined || null) {
        this.fillForm = {};
      } else {
        this.fillForm = res.userInfo.userInfo;
      }
    },
    // 进入个人中心的页面
    enterHome() {
      let userType = sessionStorage.getItem("userType");
      console.log(userType);
      if (userType) {
        if (userType == 9 || userType == 13) {
          this.$router
            .push({
              path: "/self/manage/manUser"
            })
            .catch(() => {});
        } else if (userType == 10) {
          this.$router
            .push({
              path: "/self/partner/partIndex"
            })
            .catch(() => {});
        } else if (userType == 11) {
          this.$router.push({
            path: "/self/company/compIndex"
          });
        } else if (userType == 12) {
          this.$router
            .push({
              path: "/self/adviser/advIndex"
            })
            .catch(() => {});
        }
      } else {
        this.$message({
          type: "error",
          message: "请登录"
        });
      }
    },
    // 离开个人中心页面
    leaveHome() {
      let userType = sessionStorage.getItem("userType");
      if (!userType) {
        this.$message({
          type: "info",
          message: "已离线"
        });
      } else {
        sessionStorage.setItem("id", "");
        sessionStorage.setItem("userType", "");
        sessionStorage.setItem("token", "");
        this.$message({
          type: "success",
          message: "退出成功"
        });
        this.$router.push({
          path: "/centerHome/centerIntroduce"
        });
      }
    }
  },
  mounted() {
    this.flag = this._isMobile();
    // console.log(this.flag);
  },
  created() {
    this.infoId();
    this.currentType = sessionStorage.getItem("userType");
  }
};
</script>

<style scoped>
@import url("~assets/styles/common/Header.css");
.menuList a {
  color: #ccc;
  text-decoration: none;
}
.headerTitle-a {
  color: #666;
  text-decoration: none;
}
.Logo {
  margin: 0 auto;
  display: block;
}
.selectIdentity {
  text-align: center;
  color: #fff;
  margin-top: 20px;
  font-size: 14px;
}
.loginForm {
  margin-top: 20px;
}
.selectRadio {
  margin: 0px auto;
  width: 170px;
}
.button {
  margin: 0 auto;
  width: 160px;
  cursor: pointer;
}
.footer {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
.el-radio /deep/ .el-radio__label {
  padding: 0 !important;
}
.el-dialog__body {
  padding: 0 30px !important;
}
.fill-pc {
  display: block;
}
.fill-pc h2 {
  color: white;
  font-weight: 700;
  font-size: 20px;
  text-align: center;
  margin-bottom: 10px;
}
.btn {
  display: flex;
  justify-content: center;
}
.fill-phone {
  position: absolute;
  left: 0;
  right: 0;
  top: 65px;
  bottom: 0;
  z-index: 100;
  margin: 0px auto;
  font-size: 14px;
  display: none;
}
.phone {
  background-color: rgb(255, 255, 255);
  width: 100vw;
  padding: 0 10px;
  height: 95vh;
  box-sizing: border-box;
}
.phone .title {
  display: flex;
  text-align: center;
  padding: 10px 0;
}
.phone .title :nth-child(1) {
  flex: 9;
  font-size: 18px;
  font-weight: 600;
}
.phone .title :nth-child(2) {
  flex: 1;
}
.phone ul li {
  display: flex;
  height: 50px;
  line-height: 50px;
  border-bottom: 1px solid #eee;
}
.phone ul li span {
  flex: 1;
}
.phone ul li span:nth-child(2) {
  text-align: right;
  flex: 2;
}
.phone ul li .el-input {
  width: 65%;
}
.action {
  margin-top: 25px;
}
.imgTitle {
  width: 100%;
  height: auto;
}
.Logo {
  width: 80%;
}
@media screen and (max-width: 768px) {
  .fill-pc {
    display: none;
  }
  .fill-phone {
    display: block;
  }
}
</style>
